package 课工场练习;

public class Bus extends Vehicle {
	// 座位数
	private int seatCount;

	public void setSeatCount(int seatCount) {
		this.seatCount = seatCount;
	}

	public int getSeatCount() {
		return seatCount;
	}

	public Bus() {
	}

	// Bus的带参构造方法
	public Bus(String id, String brand, int perRent, int seatCount) {
		super(id, brand, perRent);
		this.seatCount = seatCount;
	}

	// 重写父类的计算租金方法：根据自己的计算租金规则
	public double calcRent(int days) {
		double price = this.getPerRent() * days;
		if (days >= 3 && days < 7) {
			price *= 0.9;
		} else if (days >= 7 && days < 30) {
			price *= 0.8;
		} else if (days >= 30 && days < 150) {
			price *= 0.7;
		} else if (days > 150) {
			price *= 0.6;
		}
		return price;

	}
}